<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : teamSelect.xsl
    Created on : 28.4.2010, 14:22:23
    Author     : Football-Statistics Team
    Description: team selection transformation
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" omit-xml-declaration="yes" media-type="html/text"/>
    <xsl:param name="team"/>
    <xsl:param name="redirect"/>
    <xsl:param name="select_team"/>
    <xsl:template match="/teams">
        <select onchange="location.href='{$redirect}'+this.value">
        <option value=""><xsl:value-of select="$select_team"/></option>
        <xsl:for-each select="team">
                <xsl:choose>
                    <xsl:when test=".=$team">
                        <option value="{.}" selected="selected"><xsl:value-of select="."/></option>
                    </xsl:when>
                    <xsl:otherwise>
                        <option value="{.}"><xsl:value-of select="."/></option>
                    </xsl:otherwise>
                </xsl:choose>
        </xsl:for-each>
        </select>
    </xsl:template>
</xsl:stylesheet>
